package com.siashan.unipay4j.wx.pay;

import com.siashan.unipay4j.core.IBaseEnum;
import com.siashan.unipay4j.core.TradeStateEnum;

/**
 * 交易状态
 *
 * @author  siashan
 * @since  v1.0.1
 **/
public enum WxTradeStateEnum implements IBaseEnum<String> {
    /**
     * 支付成功
     */
    SUCCESS("SUCCESS", "支付成功", TradeStateEnum.SUCCESS),
    /**
     * 转入退款
     */
    REFUND("REFUND", "转入退款", TradeStateEnum.CLOSED),
    /**
     * 未支付
     */
    NOTPAY("NOTPAY", "未支付", TradeStateEnum.FAIL),
    /**
     * 已关闭
     */
    CLOSED("CLOSED", "已关闭", TradeStateEnum.CLOSED),
    /**
     * 已撤销（付款码支付）
     */
    REVOKED("REVOKED", "已撤销（付款码支付）", TradeStateEnum.REVOKED),
    /**
     * 用户支付中（付款码支付）
     */
    USERPAYING("USERPAYING", "用户支付中（付款码支付）", TradeStateEnum.USERPAYING),
    /**
     * 支付失败(其他原因，如银行返回失败)
     */
    PAYERROR("PAYERROR", "支付失败(其他原因，如银行返回失败)", TradeStateEnum.FAIL),
    /**
     * 已接收，等待扣款)
     */
    ACCEPT("ACCEPT", "已接收，等待扣款)", TradeStateEnum.USERPAYING),
    ;
    private String value;
    private String desp;
    private TradeStateEnum tradeState;

    WxTradeStateEnum(String value, String desp, TradeStateEnum tradeState) {
        this.value = value;
        this.desp = desp;
        this.tradeState = tradeState;
    }

    @Override
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public String getDesp() {
        return desp;
    }

    public void setDesp(String desp) {
        this.desp = desp;
    }

    public TradeStateEnum getTradeState() {
        return tradeState;
    }

    public void setTradeState(TradeStateEnum tradeState) {
        this.tradeState = tradeState;
    }
}
